package test1;
import java.util.ArrayList;
import java.util.Random;
public class yanzhengma {
    public static void main(String[] args) {
        String str = yanzhenma();
        System.out.println(str);
    }
        public static String yanzhenma(){
            ArrayList<Character> list = new ArrayList<>();
            StringBuilder sb =new StringBuilder();
            for (int i = 0; i < 26; i++) {
                list.add((char)('a'+i));
                list.add((char)('A'+i));
            }
            Random r = new Random();
            for (int i = 0; i < 4; i++) {
                int index = r.nextInt(list.size());
                char c = list.get(index);
                sb.append(c);
            }
            int number = r.nextInt(10);
            sb.append(number);
            char[] arr = sb.toString().toCharArray();
            int randomnIndex = r.nextInt(arr.length);
            char temp = arr[randomnIndex];
            arr[randomnIndex] = arr[arr.length-1];
            arr[arr.length-1] = temp;
            return new String(arr);

}
    }